//
//  UIView+ILGUIKit.h
//  WangHuo
//
//  Created by zhangtongle on 2017/6/16.
//  Copyright © 2017年 ifeng. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(int, ILGToastPosition) {
    ILGToastPositionTop = 0,
    ILGToastPositionCenter = 1,
    ILGToastPositionBottom = 2
};

@interface UIView (ILGUIKit)

+ (instancetype)ilg_viewFromXIB:(NSString *)xibName;

/// 如何点击移动中的view: 在controller或者view的superview中的touchesBegan中, 使用movingView调用本方法
/// @param touches touches
- (void)ilg_handleTapEventForMovingView:(NSSet<UITouch *> *)touches callback:(void(^)(UIView *movingView))callback;

/// 如何点击移动中的view？
/// @param touchPointInSuperView 父视图中的touch point
/// @param callback callback
/// @discussion 使用movingView调用本方法
- (void)ilg_handleTapEventForMovingViewWithTouchPoint:(CGPoint)touchPointInSuperView callback:(void(^)(UIView *movingView))callback;

@end


@interface UIView (ILGUIKit_alert)

- (void)ilg_makeToast:(NSString *)message;
- (void)ilg_makeToast:(NSString *)message position:(ILGToastPosition)position;
+ (void)ilg_makeToast:(NSString *)message;
+ (void)ilg_makeToast:(NSString *)message position:(ILGToastPosition)position;

+ (void)ilg_showTopAlertWithText:(NSString *)text;
+ (void)ilg_showTopAlertWithText:(NSString *)text autoHide:(BOOL)isAutoHide;
+ (void)ilg_hideTopAlert;

@end


@interface UIView (ILGUIKit_frame)

@property (nonatomic, assign) CGFloat ilg_x;
@property (nonatomic, assign) CGFloat ilg_y;
@property (nonatomic, assign) CGFloat ilg_width;
@property (nonatomic, assign) CGFloat ilg_height;
@property (nonatomic, assign) CGFloat ilg_leading;
@property (nonatomic, assign) CGFloat ilg_tailing;
@property (nonatomic, assign) CGFloat ilg_top;
@property (nonatomic, assign) CGFloat ilg_bottom;
@property (nonatomic, assign) CGSize ilg_size;
@property (nonatomic, assign) CGFloat ilg_centerX;

@property (nonatomic, readonly, assign) CGSize screenSize;
@property (nonatomic, readonly, assign) CGFloat screenWidth;
@property (nonatomic, readonly, assign) CGFloat screenHeight;

@end
